cli: configure and launch with a custom OAuth app - #518
Draft
andy-xu-db wants to merge 1 commit into
Draft
Conversation
This was referenced Sep 8, 2026
Persist a custom OAuth client ID per workspace, use it during configure, and pin it in Claude's apiKeyHelper. Keep other agents on host-based saved-state resolution.
andy-xu-db
force-pushed
the
andy-xu_data/stack/oauth-auth-token-flag
branch
from
September 8, 2026 20:34
82d4a9d to
b66c32d
Compare
andy-xu-db
force-pushed
the
andy-xu_data/stack/oauth-configure-client-id
branch
from
September 8, 2026 20:35
e67b5d7 to
c4babd1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Makes the flag usable end to end:
ug claude --oauth-client-id <id>— alsoug codex, bareug, andug configure— signs in through a custom OAuth app, and every agent config it writes keeps minting from that same app.Noneinherits (likeuse_pat), so re-launches can drop the flag;--oauth-client-id ""reverts to the built-in app.apiKeyHelper, Codex'sauth.args(current + legacy overlay), opencode's plugin, theucode mcp-proxyargv, both smart-routing hooks.--oauth-client-idthat disagrees with the cached config forces a reconfigure instead of launching with a helper pointed at the other app.No change needed in
doctor.pyorsmart_routing/v2.py.Rollout: the flag only picks the app — the integration itself still needs
refresh_token_ttl_in_minutes = 129600, since new ones default to10080(7 days).Jira: AIGTWY-4550
Testing
uv run pytest2,349 passed (+27, same 21 pre-existing failures; 2,249 → 2,349 across the stack);ruff check,ruff format --check,ty check src/clean. New tests cover persist-before-auth, inheritance,""clearing, the cached-config rejection, flag forwarding for claude/codex, and the pinned id in every generated config.🥞 Stacked PR
This pull request and its description were written by Isaac.